package com.spring.boot.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @program: springboot_vue
 * @description: swagger测试
 * @author: ry
 * @create: 2018-08-17 13:59
 **/
@RestController
@RequestMapping("api")
@Api("swagger测试的api")
public class SwaggerController {
    private static final Logger logger= LoggerFactory.getLogger(SwaggerController.class);

    @ApiOperation(value = "根据id查询",notes = "查询数据库中的信息")
    @ApiImplicitParam(name = "id",value = "信息id",paramType = "path",required = true,dataType = "Integer")
    @RequestMapping(value = "/{id}",method = RequestMethod.GET)
        public String getInfoById(@PathVariable int id){
            logger.info("开始查询某个信息"+id);
        return "success";
    }
}
